package com.crm.model.pojo;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the kind database table.
 * 
 */
@Entity
@Table(name="kind")
@NamedQuery(name="Kind.findAll", query="SELECT k FROM Kind k")
public class Kind implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private String kid;

	private String kname;

	//bi-directional many-to-one association to Customer
	@OneToMany(mappedBy="kind")
	private List<Customer> customers;

	public Kind() {
	}

	public String getKid() {
		return this.kid;
	}

	public void setKid(String kid) {
		this.kid = kid;
	}

	public String getKname() {
		return this.kname;
	}

	public void setKname(String kname) {
		this.kname = kname;
	}

	public List<Customer> getCustomers() {
		return this.customers;
	}

	public void setCustomers(List<Customer> customers) {
		this.customers = customers;
	}

	public Customer addCustomer(Customer customer) {
		getCustomers().add(customer);
		customer.setKind(this);

		return customer;
	}

	public Customer removeCustomer(Customer customer) {
		getCustomers().remove(customer);
		customer.setKind(null);

		return customer;
	}

}